
/**
 * 
 * @param {date} dateInitial 时间字符串 如 2022-05-02
 * @param {date} dateFinal 同上
 * @returns number
 */

function getDayDiffBetweenDates(dateInitial,dateFinal){
    return (new Date(dateFinal) - new Date(dateInitial)) / (1000 * 3600 * 24)
}

console.log(getDayDiffBetweenDates('2022-12-11','2022-12-01'));